#!/bin/bash

FIRMWARE_PATH="./"

qemu-system-riscv64 \
    -device virtio-net-device,netdev=net0,mac=52:54:00:12:35:02 \
    -netdev user,id=net0,hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23 \
    -drive id=disk0,file=${FIRMWARE_PATH}/demo-coreip-qt5-qemuriscv64.ext4,if=none,format=raw \
    -device virtio-blk-device,drive=disk0 -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0 \
    -machine virt -m 1024 -serial mon:stdio -serial null -show-cursor -monitor null \
    -bios ${FIRMWARE_PATH}/fw_jump.elf \
    -kernel ${FIRMWARE_PATH}/Image \
    -append 'root=/dev/vda highres=off rw mem=1024M ip=dhcp earlycon=sbi' \
    -device virtio-gpu-pci \
    -device virtio-mouse-pci \
    -device virtio-keyboard-pci

